
cmake_minimum_required(VERSION 2.6)

PROJECT(DaoVTK)

# FIND_PACKAGE(VTK)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
  MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
IF(NOT VTK_DIR)
  MESSAGE(FATAL_ERROR "Please set VTK_DIR.")
ENDIF(NOT VTK_DIR)
INCLUDE(${VTK_USE_FILE})

IF(APPLE)
#	SET( CMAKE_SHARED_LINKER_FLAGS "-undefined dynamic_lookup" )
ENDIF()
SET( CMAKE_SHARED_LINKER_FLAGS "-ldao" )

INCLUDE_DIRECTORIES( DaoVtkCommon )
INCLUDE_DIRECTORIES( DaoVtkFiltering )
INCLUDE_DIRECTORIES( DaoVtkGraphics )
INCLUDE_DIRECTORIES( DaoVtkIO )
INCLUDE_DIRECTORIES( DaoVtkImaging )
INCLUDE_DIRECTORIES( DaoVtkRendering )
INCLUDE_DIRECTORIES( DaoVtkHybrid )
INCLUDE_DIRECTORIES( DaoVtkWidgets )

SET( SourceCommon
DaoVtkCommon/dao_VtkCommon.h
DaoVtkCommon/dao_VtkCommon.cpp
DaoVtkCommon/dao_VtkCommon2.cpp
DaoVtkCommon/dao_VtkCommon3.cpp
)
SET( SourceFiltering
DaoVtkFiltering/dao_VtkFiltering.h
DaoVtkFiltering/dao_VtkFiltering.cpp
DaoVtkFiltering/dao_VtkFiltering2.cpp
DaoVtkFiltering/dao_VtkFiltering3.cpp
)
SET( SourceGraphics
DaoVtkGraphics/dao_VtkGraphics.h
DaoVtkGraphics/dao_VtkGraphics.cpp
DaoVtkGraphics/dao_VtkGraphics2.cpp
DaoVtkGraphics/dao_VtkGraphics3.cpp
)
SET( SourceIO
DaoVtkIO/dao_VtkIO.h
DaoVtkIO/dao_VtkIO.cpp
DaoVtkIO/dao_VtkIO2.cpp
DaoVtkIO/dao_VtkIO3.cpp
)
SET( SourceImaging
DaoVtkImaging/dao_VtkImaging.h
DaoVtkImaging/dao_VtkImaging.cpp
DaoVtkImaging/dao_VtkImaging2.cpp
DaoVtkImaging/dao_VtkImaging3.cpp
)
SET( SourceRendering
DaoVtkRendering/dao_VtkRendering.h
DaoVtkRendering/dao_VtkRendering.cpp
DaoVtkRendering/dao_VtkRendering2.cpp
DaoVtkRendering/dao_VtkRendering3.cpp
)
SET( SourceHybrid
DaoVtkHybrid/dao_VtkHybrid.h
DaoVtkHybrid/dao_VtkHybrid.cpp
DaoVtkHybrid/dao_VtkHybrid2.cpp
DaoVtkHybrid/dao_VtkHybrid3.cpp
)
SET( SourceWidgets
DaoVtkWidgets/dao_VtkWidgets.h
DaoVtkWidgets/dao_VtkWidgets.cpp
DaoVtkWidgets/dao_VtkWidgets2.cpp
DaoVtkWidgets/dao_VtkWidgets3.cpp
)

ADD_LIBRARY( DaoVtkCommon SHARED ${SourceCommon} )
ADD_LIBRARY( DaoVtkFiltering SHARED ${SourceFiltering} )
ADD_LIBRARY( DaoVtkGraphics SHARED ${SourceGraphics} )
ADD_LIBRARY( DaoVtkIO SHARED ${SourceIO} )
ADD_LIBRARY( DaoVtkImaging SHARED ${SourceImaging} )
ADD_LIBRARY( DaoVtkRendering SHARED ${SourceRendering} )
ADD_LIBRARY( DaoVtkHybrid SHARED ${SourceHybrid} )
ADD_LIBRARY( DaoVtkWidgets SHARED ${SourceWidgets} )

TARGET_LINK_LIBRARIES( DaoVtkCommon vtkCommon )
TARGET_LINK_LIBRARIES( DaoVtkFiltering vtkFiltering DaoVtkCommon )
TARGET_LINK_LIBRARIES( DaoVtkGraphics vtkGraphics DaoVtkFiltering )
TARGET_LINK_LIBRARIES( DaoVtkIO vtkIO DaoVtkFiltering )
TARGET_LINK_LIBRARIES( DaoVtkImaging vtkImaging DaoVtkFiltering )
TARGET_LINK_LIBRARIES( DaoVtkRendering vtkRendering DaoVtkGraphics DaoVtkIO DaoVtkImaging )
TARGET_LINK_LIBRARIES( DaoVtkHybrid vtkHybrid DaoVtkIO DaoVtkRendering )
TARGET_LINK_LIBRARIES( DaoVtkWidgets vtkWidgets DaoVtkHybrid DaoVtkRendering )
